function  patch =  get_subpart_patch(orig, patchSiz, im)
    sz      =   size(im);
    orig    =   round(orig);
    left    =   max(orig(1), 1);    top     =   max(orig(2),1);
    right   =   min(orig(1)+patchSiz(1)-1, sz(2));
    bottom  =   min(orig(2)+patchSiz(2)-1, sz(1));
    
    nleft    =   left-orig(1)+1;    ntop     =   top-orig(2)+1;
    nright   =   right-orig(1)+1;   nbottom  =   bottom-orig(2)+1;
        
    patch   =   zeros(patchSiz(2),patchSiz(1), size(im,3));
    for s = 1:size(im,3)
        temp    =   im(top:bottom, left:right, s);
        patch(ntop:nbottom, nleft:nright, s)     =   temp(:,:);
    end
    
%    subPart_orig    =   convell_set.min_xy + trans;
%         subPart_sz      =   convell_set.sz;
%         subPart_rb      =   subPart_orig + subPart_sz -1;
%         
%         subPart_region  =   aligned_im(subPart_orig(2):subPart_rb(2),
%         subPart_orig(1):subPart_rb(1));
